/**
 *
 */
package cn.hg.jfsa.manage.controller.login.validator;

import com.jfinal.core.Controller;

import cn.hg.base.jfinal.validator.BaseValidator;

/**
 * @author Golly
 */
public class ManageLoginValidator extends BaseValidator {

	@Override
	protected void handleError (Controller c) {
		c.keepPara();
		c.render("login.html");
	}

	@Override
	protected void validate (Controller c) {

		if (c.getRequest().getMethod().equals("POST")) {
			this.setShortCircuit(true);
			this.validateString("account", 2, 20, "errMsg", "账号必须填写2到20长度的字符！");
			this.validateString("password", 6, 20, "errMsg", "密码必须填写6到20长度的字符！");
		}

	}

}
